package city.spring.modules.consumptionItem.action.model;

public abstract class AbstractProjectBed<BEDS> {

    /**
     * 床的唯一Key
     *
     * @return 唯一键值
     */
    public abstract Object getKey();

    /**
     * 获取原始对象
     *
     * @return 原始对象
     */
    public abstract BEDS getObject();

    @Override
    public boolean equals(Object object) {
        if (object instanceof AbstractProjectBed) {
            AbstractProjectBed<?> ProjectBed = (AbstractProjectBed<?>) object;
            Object key1 = this.getKey();
            Object key2 = ProjectBed.getKey();
            return key1 != null && key1.equals(key2);
        }
        return false;
    }

}
